1. Field of the Invention
The present invention relates to database copying technology, and in particular to technology for increasing generality.
2. Description of the Related Art
Recently with the internationalization of business and 24 hour services, there has been an increase in the requirement for non-stop operation of computer systems for executing application programs.
With computer systems, for maintenance of hardware and the like it is necessary to stop the system. With the non-stop operation of computer systems however, since the system cannot be stopped, then maintenance cannot be performed. Therefore, an operation mode has been considered where two sets of computer systems are prepared, and maintenance is performed by alternately switching operation to thereby stop one system.
However, since the maintenance operation also includes maintenance of the disk unit, the same disk unit cannot be shared between the two computer systems. Consequently, it is necessary to have a separate disk unit for each system, and at the time of operation switching, it is necessary to copy the database (referred to hereunder as DB). With the database copying, this must be at a sufficient speed to the extent that the service for the computer system user is not stopped.
To address this problem, the present inventors have proposed a copy method for an update system database (refer to Japanese Unexamined Patent Publication No. 10-207754). With this technique, only when the database is updated by the application program with respect to data which has been extracted, is the equivalence of the DB acquiring and reflecting the update difference guaranteed. Then, at the time of data extraction, the range to be extracted is exclusively occupied, and the records within this range and the inter-record connection relations (referred to hereunder as set relations) are extracted at a time.
However, depending on the DB construction, the set relations may extend over the whole DB, so that there is the possibility of the following deficiency. That is to say, in the case where the set relations extend over the whole DB, the whole DB is exclusively occupied and the data extracted. Hence in practice, DB updating becomes impossible. Consequently, with the conventional technology, there is a restriction on the DB construction in relation to copying of the DB, so that the generality drops.
The present invention takes into consideration the heretofore problems, with the object of providing a database copying technique with increased generality, which efficiently performs DB copying irrespective of the DB structure.
Furthermore, it is an object to distribute a recording medium recorded with a database copying program according to the present invention, so that a person acquiring the recording medium can easily construct a database copy apparatus.
For achieving the above objects, a first solution device is characterized in that a database copy apparatus comprises: a data copying device for partitioning a copy source database into predetermined regions, and copying records and inter-record connection relations contained in the respective regions to a copy target database; a connection relations extraction device for extracting from the copy source database the inter-record connection relations respectively contained in different regions; and a connection relations duplication device for duplicating the inter-record connection relations copied to the copy target database by the data copying device, based on the connection relations extracted by the connection relations extraction device.
With such a construction, copying of the database is performed as follows.
(1) The copy source database is partitioned into predetermined regions, and the records and the inter-record connection relations contained in the respective regions are copied to the copy target database.
(2) The inter-record connection relations respectively contained in different regions are extracted from the copy source database.
(3) The inter-record connection relations copied to the copy target database are duplicated based on the extracted connection relations.
Consequently, even when the inter-record connection relations extend to the whole database, the database copying for the partitioned region units is performed, after which the inter-record connection relations respectively contained in the different regions are duplicated. Therefore, the exclusive occupation of the database spanning a wide range as with the conventional technology becomes unnecessary, so that for example it becomes possible to perform database copying during operation of an on line system. Moreover, database copying can be efficiently performed irrespective of the database construction, so that generality related to database copying can be increased.
Furthermore, the construction may comprise: an update difference acquisition device for acquiring, when there is a database update request for the region of the copy source database in which the records and the inter-record connection relations have been copied by the data copying device, an update difference due to the database update request; a data update device for updating records and inter-record connection relations which have been copied to the copy target database by the data copying device, based on the update difference acquired by the update difference acquisition device; and a connection relations update device for updating connection relations extracted by the connection relations extraction device, based on the update difference acquired by the update difference acquisition device.
With such a construction, when there is a database update request for the region of the copy source database in which the records and the inter-record connection relations have been copied, the update difference due to the database update request is acquired. That is to say, even if updating is performed with respect to the region in which the records and the like in the copy source database have already been copied, since that updating is not reflected in the copy target database, then the update difference is acquired. Then based on the acquired update difference, the records and the inter-record connection relations copied to the copy target database, and the inter-record connection relations respectively contained in the different regions are updated. After this, based on the inter-record connection relations contained in the updated different regions, the inter-record connection relations copied to the copy target database are duplicated. Consequently, even during database copying, it is possible for example to process database update requests from an application program, thus enabling application to various on line systems.
Moreover, the construction may be such that there is provided; a processing completion judgment device for judging if processing of the copy source database by the data copying device and the connection relations extraction device has been completed, and, when there is a database update request of the copy source database in which the records and the inter-record connection relations have been copied by the data copying device, an update difference acquisition device for acquiring the update difference due to the database update request and the connection relations duplication device, when judged by the processing completion judgment device that the processing of the copy source database has been completed, duplicates and updates the inter-record connection relations copied to the copy target database by the data copying device, based on the connection relations extracted by the connection relations extraction device and the update difference acquired by the update difference acquisition device.
With such a construction, when there is a database update request for the region of the copy source database in which the records and the inter-record connection relations have been copied, the update difference due to the database update request is acquired. Then, when the processing of the copy source database has been completed, the inter-record connection relations copied to the copy target database are duplicated and updated based on the connection relations and the update difference. Consequently, the update processing for the extracted connection relations becomes unnecessary, enabling a further improvement in the database copying efficiency.
Apart from this, the construction may be such that the connection relations extracted by the connection relations extraction device are stored on a non-volatile storage medium.
Here the non-volatile storage medium is for example a storage medium such as a hard disk unit which can hold the contents even if the power is interrupted.
With such a construction, then even if the connection relations extracted by the connection relations extraction device become large, since memory consumption of the computer system is restrained, demands on the hardware of the computer system can be alleviated. Moreover, even if during database copying the computer system goes down, since the connection relations are saved, the data can be recovered at the time of restarting.
A second solution device is characterized in that a database copy method comprises: a data copying step for partitioning a copy source database into predetermined regions, and copying records and inter-record connection relations contained in the respective regions to a copy target database; a connection relations extraction step for extracting from the copy source database the inter-record connection relations respectively contained in different regions; and a connection relations duplication step for duplicating the inter-record connection relations copied to the copy target database by the data copying step, based on the connection relations extracted by the connection relations extraction step.
With such a construction, copying of the database is performed as follows.
(1) The copy source database is partitioned into predetermined regions, and the records and the inter-record connection relations contained in the respective regions are copied to the copy target database.
(2) The inter-record connection relations respectively contained in different regions are extracted from the copy source database.
(3) The inter-record connection relations copied to the copy target database are duplicated based on the extracted connection relations.
Consequently, even when the inter-record connection relations extend to the whole database, the database copying for the partitioned region units is performed, after which the inter-record connection relations respectively contained in the different regions are duplicated. Therefore, the exclusive occupation of the database spanning a wide range as with the conventional technology becomes unnecessary, so that for example it becomes possible to perform database copying during operation of an on line system. Moreover, database copying can be efficiently performed irrespective of the database construction, so that generality related to database copying can be increased.
A third solution device is characterized in that a recording medium is recorded with a database copy program for realizing: a data copying function for partitioning a copy source database into predetermined regions, and copying records and inter-record connection relations contained in the respective regions to a copy target database; a connection relations extraction function for extracting from the copy source database the inter-record connection relations respectively contained in different regions; and a connection relations duplication function for duplicating the inter-record connection relations copied to the copy target database by the data copying function, based on the connection relations extracted by the connection relations extraction function.
Here, xe2x80x9crecording mediumxe2x80x9d means any medium which allows reliable recording of various information and which also allows the reliable retrieval of the information as required; for example portable recording media such as magnetic tapes, magnetic disks, magnetic drums, IC cards and CD ROMs.
With such a construction, a database copy program for realizing a data copying function, a connection relations extraction function, and a connection relations duplication function is recorded on a recording medium. Consequently, with a recording medium on which the relevant program is recorded, a database copy apparatus according to the present invention can be easily constructed using a standard computer system.